package top.jamewen.framework.sbmp.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;
import top.jamewen.framework.sbmp.common.model.UmsMenu;
import top.jamewen.framework.sbmp.model.vo.UmsMenuNodeVO;

import java.util.List;

/**
 * <p>
 * 后台菜单表 服务类
 * </p>
 *
 * @author jamewen
 * @since 2021-01-13
 */
public interface UmsMenuService extends IService<UmsMenu> {

    /**
     * 创建后台菜单
     * @author JameWen
     * @date 2021/1/14
     * @param umsMenu
     * @return boolean
     */
    @Transactional(rollbackFor = Exception.class)
    boolean create(UmsMenu umsMenu);

    /**
     * 修改后台菜单
     * @author JameWen
     * @date 2021/1/14
     * @param id
     * @param umsMenu
     * @return
     */
    @Transactional(rollbackFor = Exception.class)
    boolean update(Long id, UmsMenu umsMenu);

    /**
     * 分页查询后台菜单
     * @author JameWen
     * @date 2021/1/14
     * @param parentId
     * @param pageSize
     * @param pageNum
     * @return
     */
    Page<UmsMenu> list(Long parentId, Integer pageSize, Integer pageNum);

    /**
     * 树形结构返回所有菜单列表
     * @author JameWen
     * @date 2021/1/14
     * @param
     * @return
     */
    List<UmsMenuNodeVO> treeList();

    /**
     * 修改菜单显示状态
     * @author JameWen
     * @date 2021/1/14
     * @param id
     * @param hidden
     * @return boolean
     */
    @Transactional(rollbackFor = Exception.class)
    Boolean updateHidden(Long id, Integer hidden);

    /**
     * 根据用户id获取菜单列表
     * @author JameWen
     * @date 2021/1/14
     * @param adminId
     * @return
     */
    List<UmsMenu> getMenuList(Long adminId);

    /**
     * 根据权限id获取菜单列表
     * @author JameWen
     * @date 2021/1/14
     * @param roleId
     * @return
     */
    List<UmsMenu> listMenu(Long roleId);
}
